def concat(*args):
    for arg in args:
        for obj in arg:
            yield obj

def iterable(x):
    return hasattr(x, '__iter__')

def iterable_except_str(x):
    return iterable(x) and type(x) is not str

def flatten(*args, **kwargs):
    def impl(i, iterable):
        for j in i:
            if iterable(j):
                for k in impl(j, iterable):
                    yield k
            else:
                yield j
    return impl(args, kwargs.get('iterable', iterable_except_str))
